package game;

import com.golden.gamedev.object.Timer;
import com.golden.gamedev.object.Sprite;

public class MGTower extends Tower
{

	public MGTower(TowerDefense owner, double x, double y)
	{
		super(owner, owner.getImage("resources/mgtower.png"), x, y);
		
		firingRate = new Timer(300);
		
		projectileImage = owner.getImage("resources/bullet.png");
	}
	
	public void update(long elapsedTime)
	{
		super.update(elapsedTime);
		
		if(firingRate.action(elapsedTime))
		{
			Sprite projectile = new Sprite(projectileImage, getX()+57, getY()+17);
			projectile.setHorizontalSpeed(0.15);
			myOwner.TOWER_PROJECTILES.add(projectile);
		}
	}

}
